﻿using System;
using System.Web.UI;
using MichaelKappel.Net.CSharp;
using phudieuhungthinh.BL;
using phudieuhungthinh.BL.Model;

namespace phudieuhungthinh
{
    public partial class About : Page
    {
        private const string AboutConstant = "About";

        protected void Page_Load(object sender, EventArgs e)
        {
            var content = HelperCache.Get<string>(AboutConstant);
            if (content == null)
                lock (this)
                {
                    var articleImpl = new ArticleImpl();
                    ArticleModel model = articleImpl.GetArticle(ArticleType.About);
                    if (model != null)
                    {
                        content = model.ArticleContent;
                        HelperCache.Add(AboutConstant, content, HelperCache.CachingTime.ShortTermSliding);
                    }
                }

            pnlContent.Controls.Add(new LiteralControl(content));
        }
    }
}